// hook: useState
// const [counter, setCounter] = {counter: , setCounter:}

// function useState(state: any) {
//   let currentState = state
//   const changeState = (newState: any) => {
//     currentState = newState
//   }

//   const tuple: [any, (newState: any) => void] = [currentState, changeState]
//   return tuple
// }

// const [counter, setCounter] = useState(10);
// setCounter(1000)

// const [title, setTitle] = useState("abc")

export {}


function useState<T>(state:T):[T,(newState:T)=>void]{
  let currentState=state
  const changeState=(newState:T)=>{
    currentState=newState
  }
  //const tuple:[T,(newState:T)=>void]=[currentState,changeState]
  //return tuple
  return [currentState,changeState]
}
const [counter,setCounter]=useState(10)
setCounter(100)
const [title, setTitle] = useState("abc")
setTitle('568')